package training;

import java.util.Arrays;
import java.util.Scanner;
// https://www.nowcoder.com/questionTerminal/433c0c6a1e604a4795291d9cd7a60c7a
public class Day37_02 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()) {
            int n = scanner.nextInt();
            String[] strings = new String[n];
            scanner.nextLine();
            for (int i = 0; i < strings.length; i++) {
                strings[i] = scanner.nextLine();
            }
            Arrays.sort(strings);
            //boolean[] flag = new boolean[n];
            for (int i = 0; i < strings.length-1; i++) {
                boolean flag = false;
                if(strings[i].equals(strings[i+1])) {
                    flag = true;
                } else {
                    int index = strings[i + 1].indexOf(strings[i]);
                    if (index != -1 && strings[i + 1].charAt(index + strings[i].length()) == '/') {
                        flag = true;
                    }
                }
                if (!flag) {
                    System.out.println("mkdir -p " + strings[i]);
                }
            }
            System.out.println("mkdir -p " + strings[n-1]);
            System.out.println();
        }
    }
}
